package com.macro.mall.common.exception;

public class ExceptionCode implements IResultStatus {

    public static final ExceptionCode OK = new ExceptionCode(200, "操作成功");
    public static final ExceptionCode SYSTEM_ERROR = new ExceptionCode(600, "系统异常");
    public static final ExceptionCode PARAMS_MISS = new ExceptionCode(602, "您的输入有误，请重新确认");
    public static final ExceptionCode PARAM_ERROR = new ExceptionCode(603, "参数非法");
    public static final ExceptionCode INTERNAL_SERVER_ERROR = new ExceptionCode(604, "系统开小差了，请稍后再试（可联系客服咨询哦）");
    public static final ExceptionCode NOT_IMPLEMENTED = new ExceptionCode(605, "业务异常");
    public static final ExceptionCode USER_ID_ERROR = new ExceptionCode(606, "用户标识异常");
    public static final ExceptionCode FAIL = new ExceptionCode(607, "操作失败");
    public static final ExceptionCode TOO_BUSY = new ExceptionCode(608, "系统繁忙，请稍后再试");
    public static final ExceptionCode DUPLICATE = new ExceptionCode(609, "该数据已存在");
    public static final ExceptionCode LOGIN_FAILURE = new ExceptionCode(610, "登录失效，请重新登录");
    public static final ExceptionCode UNKNOWN_TYPE = new ExceptionCode(611, "未知的枚举类型");
    public static final ExceptionCode TOO_FAST = new ExceptionCode(612, "操作太快，请稍后再试");
    public static final ExceptionCode GET_FAIL = new ExceptionCode(613, "获取失败");
    public static final ExceptionCode VERIFICA_ERROR = new ExceptionCode(614, "验证码错误");
    public static final ExceptionCode DATA_NOT_EXIST = new ExceptionCode(623, "该数据不存在");
    public static final ExceptionCode NOT_DATA = new ExceptionCode(624, "暂无数据");
    public static final ExceptionCode DATA_EXIST = new ExceptionCode(625, "该数据已存在");
    public static final ExceptionCode MYBATIS_ERROR = new ExceptionCode(626, "mybatis的异常");


    private int code;
    private String msg;

    public ExceptionCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ExceptionCode(String msg) {
        this.code = 9999;
        this.msg = msg;
    }


    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }
}
